<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/inc/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>权限权限维护Form</title>
<%@ include file="/inc/head.jsp"%>
</head>
<script type="text/javascript">
	var submitForm = function($dialog, $grid, $pjq) {
		if ($('form').form('validate')) {
			var url;
			if ($(':input[name="id"]').val().length > 0) {
				url = sy.contextPath + '/sys/permission/permission/update';
			} else {
				url = sy.contextPath + '/sys/permission/permission/create';
			}
			$.post(url, sy.serializeObject($('form')), function(result) {
				if (result.success) {
					$grid.datagrid('load');
					$dialog.dialog('destroy');
				} else {
					$pjq.messager.alert('提示', result.msg, 'error');
				}
			}, 'json');
		}
	};
	$(function() {
		if ($(':input[name="id"]').val().length > 0) {
			parent.$.messager.progress({
				text : '数据加载中....'
			});
			var url = sy.contextPath + '/sys/permission/permission/get';
			$.post(url, {
				id : $(':input[name="id"]').val()
			}, function(result) {
				if (result.id != undefined) {
					$('form').form('load', {
						'id' : result.id,
						'permission':result.permission,
						'name' : result.name,
						'description' : result.description,
						'show' : result.show
					});
				}
				parent.$.messager.progress('close');
			}, 'json');
		}
	});
</script>
<body>
	<form method="post" class="form">
		<fieldset>
			<legend>权限基本信息</legend>
			<table class="table" style="width: 100%;">
				<tr>
					<th>编号</th>
					<td><input name="id" value="${m.id}" readonly="readonly" /></td>
				</tr>
				<tr>
					<th>权限名称</th>
					<td><input name="name" class="easyui-validatebox"
						data-options="required:true" /></td>
				<tr>
					<th>权限标识</th>
					<td><input name="permission" class="easyui-validatebox" data-options="required:true" /></td>
				</tr>
				<tr>
					<th>详细描述</th>
					<td><input name="description" class="easyui-validatebox"
						data-options="required:true" /></td>
				</tr>
				<tr>
					<th>状态</th>
					<td><select class="easyui-combobox" name="show">
						<option value="true">在用</option>
						<option value="false">停用</option>
				</select></td>
				</tr>
			</table>
		</fieldset>
	</form>
</body>
</html>